﻿namespace ContosoUniversity.Domain.Core.Behaviours
{
    using NRepository.Samples.Core.Domain.Validation;

    public class UpdateCourseRequestContextualValidation : ContextualValidation<UpdateCourseRequest, UpdateCourseCommandModel>
    {
        public UpdateCourseRequestContextualValidation(UpdateCourseRequest context)
            : base(context)
        {
        }

        public override void Validate(ValidationMessageCollection validationMessages)
        {
            // Credits
            //if (Context.CommandModel.Credits < 1)
            //    validationMessages.Add(new ValidationMessage(nameof(Context.CommandModel.Credits), "Credit cannot be less than 1"));

            //if (Context.CommandModel.Credits > 5)
            //    validationMessages.Add(new ValidationMessage(nameof(Context.CommandModel.Credits), "Credit cannot be greater than 5"));

            //// Title
            //if (Context.CommandModel.Title.Length < 3)
            //    validationMessages.Add(new ValidationMessage(nameof(Context.CommandModel.Title), "Title length cannot be less than 3"));

            //if (Context.CommandModel.Title.Length > 50)
            //    validationMessages.Add(new ValidationMessage(nameof(Context.CommandModel.Title), "Title length cannot be greater than 50"));
        }
    }
}